﻿using System;
using System.Collections.Generic;
using System.Text;
using DotNet.Data;
using DotNet.Model;

namespace DotNet.Business
{
    public class orederBll
    {
        orederDal oDal = new orederDal();
        #region 是否存在该记录
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(int orderId)
        {
            return oDal.Exists(orderId);
        }
        #endregion

        #region 获得订单列表
        /// <summary>
        /// 获得订单列表
        /// </summary>
        /// <returns></returns>
        public IList<oreder> GetModel()
        {
            return oDal.GetModel();
        }
        #endregion

        #region 根据订单号查询实体
        /// <summary>
        /// 根据订单号查询实体
        /// </summary>
        /// <param name="orderId"></param>
        /// <returns></returns>
        public oreder GetModel(int orderId)
        {
            return oDal.GetModel(orderId);
        }
        #endregion

        #region 修改订单信息
        /// <summary>
        /// 修改订单信息
        /// </summary>
        /// <param name="oreder"></param>
        /// <returns></returns>
        public bool Update(oreder oreder)
        {
            return oDal.Update(oreder);
        }
        #endregion

        #region 删除订单根据订单号
        /// <summary>
        /// 删除订单根据订单号
        /// </summary>
        /// <param name="orderId"></param>
        /// <returns></returns>
        public bool Delete(int orderId)
        {
            return oDal.Delete(orderId);
        }
        #endregion

        #region 添加订单
        /// <summary>
        /// 添加订单
        /// </summary>
        /// <param name="oreder"></param>
        /// <returns></returns>
        public bool Insert(oreder oreder)
        {
            return oDal.Insert(oreder);
        }
        #endregion
    }
}
